module.exports = {
  /**
   * Application configuration section
   * http://pm2.keymetrics.io/docs/usage/application-declaration/
   */
  apps : [

    // First application
    {
      name      : 'movie-chat',
      script    : 'app.js',
      env: {
        COMMON_VARIABLE: 'true'
      },
      env_production : {
        NODE_ENV: 'production'
      }
    }
  ],

  /**
   * Deployment section
   * http://pm2.keymetrics.io/docs/usage/deployment/
   */
  deploy : {
    production : {
      'user' : 'root',
      'host' : ['47.104.24.198'],
      'ref'  : 'origin/master',
      'repo' : 'git@gitee.com:meishuchun/movie-chat.git',
      // pm2 打开的目录会在path后面加个source 所以服务器上要在项目目录下 git clone xxx.git source
      'path' : '/home/www/server/movie-chat',
      'post-deploy' : 'source /etc/profile && git pull && npm install && pm2 startOrRestart ecosystem.config.js --env production',
      'env'  : {
        'NODE_ENV': 'production'
      }
    }
  }
};
